package com.chagee.store.operation.api.enums;

import com.google.common.collect.Sets;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;
import java.util.Set;

@Getter
@AllArgsConstructor
public enum StoreTaskEnum {
	YES("1", "合格"),
	NO("2", "不合格"),
	EMPTY("3", "无此项"),
	SYSTEM_SATISFIED("4", "合格(系统)"),
	;

	private final String type;
	private final String desc;


	public static StoreTaskEnum queryByType(String type) {
		for (StoreTaskEnum value : values()) {
			if (Objects.equals(type, value.getType())) {
				return value;
			}
		}
		return null;
	}

	public static final Set<String> TASK_ACCEPTANCE_TYPE = Sets.newHashSet(StoreTaskEnum.YES.getType(), StoreTaskEnum.NO.getType(), StoreTaskEnum.EMPTY.getType());

	public static final Set<String> TASK_APPEAL_TYPE = Sets.newHashSet(StoreTaskEnum.NO.getType(), StoreTaskEnum.EMPTY.getType());

}
